﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Sisocana.Core.Models.SiteModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Work With Sites
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="<%: Url.Content("~/Scripts/main.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>

<h2>Work With Sites</h2>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<p>
    <%: Html.ActionLink("Create New Site", "Create") %>
</p>
<% if (Model.Count() > 0){ %>
        <table>
            <tr>
                <th>Actions</th>
                <th>
                    Catastrophe Name
                </th>
                <%--<th>
                    Site Title
                </th>--%>
               <%-- <th>
                    Site Subtitle
                </th>--%>
                <th>
                    Description
                </th>
                <th>
                    Catastrophe Date
                </th>
                <th>
                    Subdomain
                </th>
                <th>
                    State
                </th>
                <th>
                    Logo               
                </th>
                <%--<th>
                    Report              
                </th>--%>
            </tr>

        <% foreach (var item in Model) { %>
            <tr>
                <td>
                <span style="width:100%">
                    <%--<%: Html.ActionLink("Configure", "Conf", new { idsitio=item.id,tab=1}) %> --%>
                    <%= Html.MakeImgLink(Url.Action("Conf", "Site", new { idsitio = item.id,tab=1 }),"Configure Site" ,"conf.png")%>|
                    <%= Html.MakeImgLink(Url.Action("index", "Reportes", new { id = item.id }),"View Reports","report.png")%>|
                    
                                        
                    <%=Html.LinkFrontEnd(item.subdominio) %>|                         
                  
                    <%= Html.VerPreview(item.id.ToString(), Server.MapPath("."))%>   
                    
                </span>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.nombreCatastrofe) %>
                </td>
                <%--<td>
                    <%: Html.DisplayFor(modelItem => item.tituloWeb) %>
                </td>--%>
               <%-- <td>
                    <%: Html.DisplayFor(modelItem => item.subtituloWeb) %>
                </td>--%>
                <td>
                    
                    <%: Html.DisplayFor(modelItem => item.descripcion) %>
                </td>
                <td>
                    <%= item.fecha.Day.ToString() + "/" + item.fecha.Month.ToString() + "/" + item.fecha.Year.ToString() %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.subdominio) %>
                </td>
                <td>
                    <% if (item.estado == "M")
                       { %>
                    Maintenance
                    <% } if (item.estado == "O") {%>
                    On-Line
                    <% } if (item.estado == "I")
                       {%>
                    inactive
                    <% } %>
                </td>
                 <td>
                <% if (item.logoNomb!=null){ %>
                    <img alt="logo" height="25px" width"25px" src='<%= Url.Action( "imagen", "Site", new { id = item.id } ) %>' />
                <%} %>
                </td>
                <%-- <td>               
                  <a href='<%:Url.Action( "index", "Reportes", new { id = item.id }) %>'> View Report</a>
                </td>--%>
                
            </tr>
        <% } %>
        </table>
<% } else {%>
    <p> Currently there is no site in the system or you dont have the access level required</p>
<% } %>
 
</asp:Content>
